<?php include_stylesheets_for_form($form) ?>
<?php include_javascripts_for_form($form) ?>

<form action="<?php echo url_for('px_payment/'.($form->getObject()->isNew() ? 'create' : 'update').(!$form->getObject()->isNew() ? '?id='.$form->getObject()->getid() : '')) ?>" method="post" <?php $form->isMultipart() and print 'enctype="multipart/form-data" ' ?>>
<?php if (!$form->getObject()->isNew()): ?>
<input type="hidden" name="sf_method" value="put" />
<?php endif; ?>
  <table>
    <tfoot>
      <tr>
        <td colspan="2">
          &nbsp;<a href="<?php echo url_for('px_payment/index?px_id='.$px_id) ?>">Cancel</a>
          <?php if (!$form->getObject()->isNew()): ?>
            &nbsp;<?php echo link_to('Delete', 'px_payment/delete?id='.$form->getObject()->getid(), array('method' => 'delete', 'confirm' => 'Are you sure?')) ?>
          <?php endif; ?>
          <input type="submit" value="Save" />
        </td>
      </tr>
    </tfoot>
    <tbody>
      <?//php echo $form ?>
    </tbody>
  </table>

	<table>

		<tfoot>
	    <tr>
	      <td colspan="2">
        	 &nbsp;<a href="<?php echo url_for('px_payment/index?px_id='.$px_id) ?>">Cancel</a>
	          <?php if (!$form->getObject()->isNew()): ?>
	            &nbsp;<?php echo link_to('Delete', 'px_payment/delete?id='.$form->getObject()->getid(), array('method' => 'delete', 'confirm' => 'Are you sure?')) ?>
	          <?php endif; ?>
	        <input type="submit" value="Save" />
	      </td>
	    </tr>
	  </tfoot>



		<tr>
	    <td colspan="3">
		   	<?php echo $form['_csrf_token']; ?>
				<?php echo $form['id']; ?>
				<?php echo $form['person_id']; ?>
	      <?php echo $form->renderGlobalErrors() ?>
	    </td>
	  </tr>



		<tr>
			<td colspan=3>
			<table><!--Main client Info Block -->
		      <th><?php echo $form['case_type']->renderLabel() ?>:</th>
		      <td>
		        <?php echo $form['case_type']->renderError() ?>
		        <?php echo $form['case_type'] ?>
		      </td>
					<th><?php echo $form['credit_line']->renderLabel() ?>:</th>
		      <td>
		        <?php echo $form['credit_line']->renderError() ?>
		        <?php echo $form['credit_line'] ?>
		      </td>
		      <th><?php echo $form['days']->renderLabel() ?>:</th>
		      <td>
		        <?php echo $form['days']->renderError() ?>
		        <?php echo $form['days'] ?>
		      </td>
			</table>
			</td>
		</tr>	
		<tr>
			
			
			<td valign=top><!--Phone Block column2 -->
				<fieldset>
					<legend>Banks</legend>
					<!--Show the previous entered Phones. Must find a way to enclose it into a hidden div. -->
			  <?php foreach($form['banks'] as $formBanks): ?>
		      <?php include_partial('bank', array('form'=>$formBanks)); ?>
		    <?php endforeach; ?>


				</fieldset>
			</td>
			
					<td valign=top>
						<table valign=top>
							<tr>
								<td>
						<fieldset>
							<legend>Online Providers</legend>

						  <?php foreach($form['onlineProviders'] as $formOnlineProvider): ?>
					      <?php include_partial('online_provider', array('form'=>$formOnlineProvider)); ?>
					    <?php endforeach; ?>

						</fieldset>
						

					</td>
					</tr>
					<tr>
					<td>
							<fieldset>
								<legend>Cards</legend>

							  <?php foreach($form['cards'] as $formCards): ?>
						      <?php include_partial('card', array('form'=>$formCards)); ?>
						    <?php endforeach; ?>

							</fieldset>
							</td>
							</tr>
							</table>
</td>
			
			<td valign=top><!--Cards Block column1 -->
						<table>

								<td>

													<fieldset>
															<legend>Remarks</legend>

														  <?php foreach($form['remarks'] as $formRemark): ?>
													      <?php include_partial('remark', array('form'=>$formRemark)); ?>
													    <?php endforeach; ?>

													</fieldset>
							</td>



						</table>
					</td>
					
			</tr>
	

	</table>














</form>




<?php slot('submenu') ?>
<ul>
	<li><?php echo link_to(image_tag('contact info.png', array('title'=>"Contact Info", 'width'=>'65px')), 'px/show?id='.$px_id) ?></li>
	<li><?php echo link_to(image_tag('personal info.png', array('title'=>"Personal Info", 'width'=>'65px')), 'px_personal/index?px_id='.$px_id) ?></li>
	<li><?php echo link_to(image_tag('passport info.png', array('title'=>"Passport Info", 'width'=>'65px')), 'passport/index?px_id='.$px_id) ?></li>
	<li><?php echo link_to(image_tag('visa.png', array('title'=>"Visa Info", 'width'=>'65px')), 'visa/index?px_id='.$px_id) ?></li>
	<li><?php echo link_to(image_tag('payment arrangements.png', array('title'=>"Payment Arrangements", 'width'=>'65px')), 'px_payment/index?px_id='.$px_id) ?></li>
	<li><?php echo link_to(image_tag('transaction history.png', array('title'=>"Transaction History", 'width'=>'65px')), 'px_transaction/index?px_id='.$px_id) ?></li>
	<li><?php echo link_to(image_tag('other note.png', array('title'=>"Other Notes", 'width'=>'65px')), 'px_note/index?px_id='.$px_id) ?></li>
</ul>
<?php end_slot() ?>